﻿<!-- This file is part of DesktopGap (http://desktopgap.codeplex.com)
 ! Copyright (c) rubicon IT GmbH, Vienna, and contributors
 ! 
 ! This program is free software; you can redistribute it and/or
 ! modify it under the terms of the GNU General Public License
 ! as published by the Free Software Foundation; either version 2
 ! of the License, or (at your option) any later version.
 ! 
 ! This program is distributed in the hope that it will be useful,
 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ! GNU General Public License for more details.
 ! 
 ! You should have received a copy of the GNU General Public License
 ! along with this program; if not, write to the Free Software
 ! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 !
 ! Additional permissions are listed in the file DesktopGap_exceptions.txt.
 ! 
-->

<Window x:Class="DesktopGap.Clients.Windows.WebBrowser.UI.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="DesktopGap" MinHeight="600" MinWidth="800" Icon="{StaticResource ResourceKey=DesktopGapLogo}" >
    <Window.Resources>
        <BitmapImage x:Key="SettingsButton" UriSource="/DesktopGap;component/Resources/gear.png" />
        <BitmapImage x:Key="FindOnPageButton" UriSource="/DesktopGap;component/Resources/find-on-page.png" />

        <BitmapImage x:Key="PageSetupButton" UriSource="/DesktopGap;component/Resources/page-setup.png" />
        <BitmapImage x:Key="PrintButton" UriSource="/DesktopGap;component/Resources/print.png" />
        <BitmapImage x:Key="ZoomButton" UriSource="/DesktopGap;component/Resources/zoom.png" />
        <BitmapImage x:Key="PrintPreviewButton" UriSource="/DesktopGap;component/Resources/print-preview.png" />

        <Style  TargetType="{x:Type TabControl}">
            <Setter Property="OverridesDefaultStyle" Value="True" />
            <Setter Property="SnapsToDevicePixels" Value="True" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TabControl}">
                        <Grid KeyboardNavigation.TabNavigation="Local">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Grid
                                Grid.Row="0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                
                                <TabPanel Name="HeaderPanel"
                                          Grid.Column="0"
                                          Margin="0"
                                          ClipToBounds="false"
                                          IsItemsHost="True"
                                  KeyboardNavigation.TabIndex="1" />

                                <Menu Grid.Column="1" Background="Transparent" Height="24" HorizontalAlignment="Right" VerticalAlignment="Top">
                                    <MenuItem >
                                        <MenuItem.Header>
                                            <Image Source="{StaticResource ResourceKey=SettingsButton}" />
                                          
                                        </MenuItem.Header>
                                        <MenuItem Header="{Binding Path=HomeMenuText}" Click="OnGotoHome">
                                            <MenuItem.Icon>
                                                <Image Source="{Binding Path=Icon}"/>
                                            </MenuItem.Icon>
                                        </MenuItem>
                                        <MenuItem Header="_Print">
                                            <MenuItem.Icon>
                                                <Image Source="{StaticResource ResourceKey=PrintButton}"/>
                                            </MenuItem.Icon>
                                            <MenuItem Header="_Print" Click="OnPrint">
                                                <MenuItem.Icon>
                                                    <Image Source="{StaticResource ResourceKey=PrintButton}"/>
                                                </MenuItem.Icon>
                                            </MenuItem>

                                            <MenuItem Header="P_rint Preview" Click="OnPrintPreview">
                                                <MenuItem.Icon>
                                                    <Image Source="{StaticResource ResourceKey=PrintPreviewButton}"/>
                                                </MenuItem.Icon>
                                            </MenuItem>

                                            <MenuItem Header="P_age Setup" Click="OnPageSetup">
                                                <MenuItem.Icon>
                                                    <Image Source="{StaticResource ResourceKey=PageSetupButton}"/>
                                                </MenuItem.Icon>
                                            </MenuItem>
                                        </MenuItem>

                                        <MenuItem Header="_Zoom">
                                            <MenuItem.Icon>
                                                <Image Source="{StaticResource ResourceKey=ZoomButton}"/>
                                            </MenuItem.Icon>
                                            <MenuItem Header="_400%" Command="{Binding Path=ZoomCommand}" CommandParameter="400" />
                                            <MenuItem Header="_200%" Command="{Binding Path=ZoomCommand}" CommandParameter="200" />
                                            <MenuItem Header="_150%" Command="{Binding Path=ZoomCommand}" CommandParameter="150" />
                                            <MenuItem Header="_125%" Command="{Binding Path=ZoomCommand}" CommandParameter="125" />
                                            <MenuItem Header="_100%" Command="{Binding Path=ZoomCommand}" CommandParameter="100" InputGestureText="{Binding Path=ResetZoomKeyboardShortcutText}" />
                                            <MenuItem Header="_75%" Command="{Binding Path=ZoomCommand}" CommandParameter="75" />
                                            <MenuItem Header="_50%" Command="{Binding Path=ZoomCommand}" CommandParameter="50" />
                                        </MenuItem>

                                        <MenuItem Header="_Find on Page" Click="OnFindOnPage"  IsEnabled="false">
                                            <MenuItem.Icon>
                                                <Image Source="{StaticResource ResourceKey=FindOnPageButton}"/>
                                            </MenuItem.Icon>
                                        </MenuItem>

                                        <MenuItem Header="_About" Click="OnAbout">
                                            <MenuItem.Icon>
                                                <Image Source="{StaticResource ResourceKey=DesktopGapLogo}"/>
                                            </MenuItem.Icon>
                                        </MenuItem>

                                    </MenuItem>
                                </Menu> 
                            </Grid>
                            <Border Grid.Row="1" BorderThickness="0 0 0 0" BorderBrush="Gainsboro">
                                
                                <ContentPresenter Name="PART_SelectedContentHost"
                                                  Margin="0"
                                                  ContentSource="SelectedContent" />
                            </Border>
                        </Grid>

                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            
        </Style>
      
    </Window.Resources>
    
    <Grid>
        <TabControl Name="_tabControl" Margin="0" />
    </Grid>

</Window>
